package com.mxd.flink.connector.operator;

import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CompletableFuture;

/**
 * @author rongdi
 * @date 2022/9/19 17:03
 */
public interface RedisOperator {

    void hset(final String key, final String hashField, final String value);

    void rpush(final String listName, final String value);

    void rpush(final String listName, final List<String> values);

    List<String> brpop(final String listName);

    List<Object> rpop(final String listName,long batchFetchRows);

    List<String> blpop(final String listName);

    List<Object> lpop(final String listName,long batchFetchRows);

    void lpush(final String listName, final String value);

    void lpush(final String listName, final List<String> values);

    void sadd(final String setName, final String value);

    void sadd(final String setName, final List<String> values);

    Set<String> spop(final String setName, final long batchFetchRows);

    void set(final String key, final String value);

    void pfadd(final String key, final String element);

    void zadd(final String key, final String score, final String element);

    void zrem(final String key, final String element);

    String hget(final String key, final String field);

    CompletableFuture<String> asyncHget(final String key, final String field);

    Map<String, String> hgetAll(final String key);

    CompletableFuture<Map<String, String>> asyncHgetAll(final String key);

    String get(final String key);

    CompletableFuture<String> asyncGet(final String key);

    void close() throws IOException;

    Long expire(final String key, final int seconds);

    void hset(final String key, final String hashField, final String value, final Integer expireTime);

    void hdel(final String key, final String field);

    void del(final String key);

    void srem(final String setName, final String value);

    boolean sismember(final String key, final String member);

    long scard(final String key);

    long incrByLong(final String key, final long value);

    void setbit(final String key, final long value, final boolean offset);

    boolean getbit(final String key, final long offset);

}
